<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
include("db.php");
$sql="select * from etudiant";
$result=mysql_query($sql,$link);
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Exam</title>
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table align="center">
	<tr><td align="center">Les notes d'un etudiant</td></tr>
	<tr><td>
		<table border='1' width="80%" align="center">
			<tr bgcolor="799AE1">
				<td width="150">Id</td>
				<td width="150">PhotoId</td>
				<td width="250">Name</td>
				<td width="150">Note</td>
			</tr>
			<?php
			while($a_rows=mysql_fetch_object($result))
			        {
			            echo"<tr><td>".$a_rows->id."</td>";
			            echo"<td>".$a_rows->photoid."</td>";
			            echo"<td>".$a_rows->name."</td>";
			            echo"<td align=center>";   

			            $sqlNote="select * from etudiant_note where photoid='$a_rows->photoid'";
			            $resultNote=mysql_query($sqlNote,$link);
			            while($ad_rows=mysql_fetch_object($resultNote))
			            {
			            	echo $ad_rows->note.',';		            	
			            }
			            echo "</td></tr>";
			        }
			?>
		</table>
	</td></tr>
	<tr><td align="center"><a href="ecrire.php">Retour page d'accueil</a></td></tr>
</table>

</body>
</html>